{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
  	<div class="layui-row">
    	<div class="layui-col-md12 layui-col-xs12">
			<div class="widget-head">
				<div class="widget-title">门店详情</div>
			</div>
		</div>
		<div class="layui-col-md12 layui-col-xs12 widget-body">
			<form id="my-form" class="layui-form" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label form-require">门店名称</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="name" value="{$info.name}" placeholder="请输入门店名称" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">联系人</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="realname" value="{$info.realname}" placeholder="请输入联系人" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">联系电话</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="mobile" value="{$info.mobile}" placeholder="请输入联系电话" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">营业时间</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="sale_time" value="{$info.sale_time}" placeholder="请输入营业时间例如:8:30-17:30" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">门店区域</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" autocomplete="on" id="city-picker" name="city-picker" readonly="readonly" data-toggle="city-picker" value="{$info.province}/{$info.city}/{$info.district}" placeholder="请输入门店区域" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">详细地址</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="address" value="{$info.address}" placeholder="请输入详细地址" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">门店坐标</label>
					<div class="layui-input-inline">
                        <input type="text" id="lng" name="lng" value="{$info.lng}" autocomplete="off" placeholder="请输入经度" class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" id="lat" name="lat" value="{$info.lat}" autocomplete="off" placeholder="请输入纬度" class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn ajax-iframe" data-width="700px" data-height="700px" href="{:url('Store/map')}">选择</button>
                    </div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">门店简介</label>
					<div class="layui-input-block">
						<textarea name='desc' rows="6" placeholder="请输入门店简介" class="layui-textarea">{$info['desc']}</textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">排序</label>
					<div class="layui-input-block">
						<input type="text" name="sort" value="{$info.sort}" autocomplete="off" placeholder="请输入排序" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label form-require">状态</label>
					<div class="layui-input-block">
						<input type="radio" name="status" value="1" title="启用" {eq name="info['status']" value="1"}checked{/eq}>
                    	<input type="radio" name="status" value="0" title="禁用" {eq name="info['status']" value="0"}checked{/eq}>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<input type="hidden" name="id" value="{$info.id}">
						<button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    	<button class="layui-btn layui-btn-primary" onclick="javascript:history.back(-1);return false;">返回</button>
					</div>						
				</div>
			</form>
		</div>
	</div>
</div>
{/block}
{block name="js"}
<link href="/static/libs/extend/city-picker/city-picker.css" rel="stylesheet" />
<script src="/static/libs/extend/city-picker/city-picker.data.js"></script>
<script>
	layui.config({
        base: '/static/libs/' //静态资源所在路径
    }).extend({
        citypicker: '{/}/static/libs/extend/city-picker/city-picker' // {/}的意思即代表采用自有路径，即不跟随 base 路径
    }).use(['jquery', 'table', 'citypicker'], function () {
        var $ = layui.$
            , table = layui.table
            , form = layui.form
            , cityPicker = layui.citypicker;

        var currentPicker = new cityPicker("#city-picker", {
            provincename:"provinceId",
            cityname:"cityId",
            districtname: "districtId",
            level: 'districtId',// 级别
        });
        //currentPicker.setValue("河南省/信阳市/新县");
    }); 
</script>
{/block}